<div>
    <el-row>
        <el-col :span="24">
            <el-form :model="ruleForm" ref="ruleForm" label-width="180px" class="demo-ruleForm" @submit.native.prevent>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="查询" prop="filed">
                            <el-input v-model="ruleForm.filed" name="filed" placeholder="查询字段" @keyup.enter.native="submitForm"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="1" style="margin-left: 10px;">
                        <el-button type="primary" @click="submitForm">查询</el-button>
                    </el-col>
                    <el-col :span="5" v-if="!isMethod">
                        <el-form-item label="查询条件">
                            <el-checkbox-group v-model="ruleForm.configs">
                                <el-checkbox label="js" name="js" >js</el-checkbox>
                                <el-checkbox label="java" name="java" >java</el-checkbox>
                            </el-checkbox-group>
                        </el-form-item>
                    </el-col>
                    <el-col :span="5">
                        <el-form-item label="展示选项">
                            <el-radio-group v-model="columnCount" @change="change">
                                <el-radio label="2" name="type">两列</el-radio>
                                <el-radio label="3" name="type">三列</el-radio>
                            </el-radio-group>
                        </el-form-item>
                    </el-col>

                </el-row>
            </el-form>
        </el-col>
    </el-row>
    <el-row v-for="i in Math.ceil(list.length / columnCount)" :key="i" style="margin-top: 10px;">
        <el-col :span="1"></el-col>
        <el-col :span="Math.floor(23 / columnCount)" v-for="(obj,index) in list.slice(columnCount * (i - 1), columnCount * (i - 1) + parseInt(columnCount))" style="box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);margin-right: 10px" >
            <el-descriptions :title=" + obj.father" size="mini" :column="2" border style="padding: 10px;"  >
                <template slot="title">
                    <span v-if="!isMethod">类名：</span>
                    <span v-else>方法名：</span> &nbsp;{{obj.name}}
                    <span v-if="!isMethod">{{(obj.type === 1) ? '.java':'.js'}}</span>
                    &nbsp;&nbsp;&nbsp;<span v-if="!isMethod && obj.type === 1">父类：</span>
                    <el-tooltip class="item changeHandle" effect="dark" :content="obj.father" placement="top" v-if="!isMethod && obj.type === 1">
                        <i class="el-icon-question"></i>
                    </el-tooltip>
                </template>
                <template slot="extra" v-if="!isMethod">
                    <el-button type="primary" size="small" @click="test(obj.path,obj.type)">查看方法</el-button>
                </template>
                <el-descriptions-item label="包路径" :labelStyle="{'width': '80px'}" :span="searchAll ? 2 : 1">{{obj.path}}</el-descriptions-item>
                <el-descriptions-item label="匹配分数" :labelStyle="{'width': '80px'}" v-if="!searchAll" :span="1">
                    <el-tag size="small">{{obj.score}}</el-tag>
                </el-descriptions-item>
                <el-descriptions-item label="描述" span="2">{{obj.desc}}</el-descriptions-item>
                <el-descriptions-item label="关键词" :labelStyle="searchAll ? {'width': '80px'} : {'width': '80px','background': '#FDE2E2'}" span="2">
                    <el-tag size="small" v-for="(keyword,index) in obj.keyWords" style="margin-right: 4px;margin-top: 4px;" v-html="keyword">
                    </el-tag>
                </el-descriptions-item>
            </el-descriptions>
        </el-col>
    </el-row>
    <el-row v-if="!list || list.length == 0">
        <el-col :span="24">
            <el-empty description="没有找到相关API"></el-empty>
        </el-col>
    </el-row>
    <el-row v-if="count > 0" style="margin-top: 10px;">
        <el-col :span="24">
            <el-pagination
                    :current-page="currentPage"
                    @current-change="pageChange"
                    :page-size="5 * columnCount"
                    :pager-count="5 * columnCount"
                    layout="prev, pager, next"
                    :hide-on-single-page="true"
                    style="text-align: center"
                    :total="count">
            </el-pagination>
        </el-col>
    </el-row>
</div>